using System.Security.AccessControl;
using TripleA.Core.Interfaces;
using TripleA.Core.Interfaces.Entities;

namespace TripleA.Core.Extensions.FileSystem
{
    public static partial class FileSystemExtensions
    {
        public static IPipelineConfig<T> FolderPermissions<T>(this IPipelineConfig<T> config, 
            string folder, string identity,
            AccessControlType accessType,
            FileSystemRights expectedRights)
            where T : Context
        {
            config.RunStep(new FolderIdentityPermissionsStep<T>(folder, identity, accessType, expectedRights));
            return config;
        }

        public static IPipelineConfig<T> FilePermissions<T>(this IPipelineConfig<T> config, 
            string filepath, string identity,
            AccessControlType accessType,
            FileSystemRights expectedRights)
            where T : Context
        {
            config.RunStep(new FileIdentityPermissionsStep<T>(filepath, identity, accessType, expectedRights));
            return config;
        }
    }
}